package com.mew.chess.core.common.message.request;

import com.zebra.common.ZebraBaseMessage;
import io.netty.buffer.ByteBuf;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

@Data
@ToString(callSuper = true)
@NoArgsConstructor
public class BetRequestMessage extends ZebraBaseMessage<BetRequestMessage> {
    private long betNumber ; //押注金额
    private int betType; //押注类型
    @Override
    public void write(ByteBuf b) {
        writeLong(b, this.betNumber);
        writeInt(b, this.betType);
    }

    @Override
    public BetRequestMessage read(ByteBuf b) {
        BetRequestMessage betRequestMessage = new BetRequestMessage();
        betRequestMessage.betNumber = readLong(b);
        betRequestMessage.betType = readInt(b);
        return betRequestMessage;
    }
}
